//
//  HNSH_SearchGoodsCell.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/24.
//

#import "HNSH_SearchGoodsCell.h"

@interface HNSH_SearchGoodsCell ()
/** 名字 */
@property (nonatomic, strong)UILabel * nameLabel;
@end

@implementation HNSH_SearchGoodsCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor appWhiteLabelColor];
        [self configUI];
    }
    return self;
}

- (void)configUI {
    [self addAllViews];
    [self addAllLayout];
}

//MARK: Cycle Methods
- (void)addAllViews{
    [self.contentView addSubview:self.nameLabel];
}

- (void)addAllLayout{
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.contentView);
    }];
}

//MARK: Setter Methods
- (void)setTitle:(NSString *)title{
    _title = title;
    
    self.nameLabel.text = title;
}

//MARK: Getter Methods
- (UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [UILabel new];
        _nameLabel.textColor = [UIColor appGray666LabelColor];
        _nameLabel.font = [UIFont systemFontOfSize:14];
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        _nameLabel.backgroundColor = [UIColor colorWithHexString:@"#F4F4F4"];
        _nameLabel.layer.cornerRadius = 13;
        _nameLabel.layer.masksToBounds = YES;
    }
    return _nameLabel;
}

@end
